Learn R Programming

RandomFields (version 3.0.32)

Random models: Random parameters

Description

Random parameters in the model definition

Arguments

Implemented models

ll{ RRdeterm no scattering RRdistr families of distributions transferred from R RRgauss a (multivariate) Gaussian random variable RRloc modification of location and scale RRspheric random scale for the RMball to simulate RMspheric, etc. RRunif a (multivariate) uniform random variable }

Details

When simulating Gaussian random fields, the random parameters are drawn only once at the very beginning. So, if the argument n in RFsimulate is greater than 1 then n simulations conditional on a single realisation of the random parameters are performed. See the examples below.

There are (simple) multivariate version and additional version to the distributions families implemented. Further, any distribution family defined in R can be used, see the examples below These function will allow for Baysian modelling. (Future project).

See Also

RC, RF, RM, RP, Other models, RFdistr, RMmodelgenerator,

Examples

Run this code
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again
## here, the scale is given by an exponential variable:
model <- RMgauss(scale=exp())
for (i in 1:4) {
  # each leads to a simulation with a different scale parameter
  plot(model) ## random !
  plot(RFsimulate(model, x=seq(0,10,0.1)))
  readline("press return")
}

# but here, all 4 simulation have same (but random) scale:
  plot(RFsimulate(model, x=seq(0,10,0.1), n=4)) 

\dontrun{
## hierarchical models are also possible:
## here, the scale is given by an exponential variable whose
## rate is given by a uniform variable
model <- RMgauss(scale=exp(rate=unif()))
plot(model)
plot(RFsimulate(model, x=seq(0,10,0.1)))
}
FinalizeExample()

Run the code above in your browser using DataLab